Changing team flags in International Superstar Soccer Deluxe
Document adapted by Lusofonia, originally written by Marcos Allan (credits on section 6)

Table of Contents
1.Introduction
2.Explanation
3.Drawing the graphics
4.In the hex editor
5.Palettes
6.Conclusion
7.Credits

1. Introduction

Changing flags in ISSD is not hard, but difficult for those who don't know much about romhacking. If you don't know much, I recommend you to get more information from the documents at romhacking.net, as they teach you the basics required here.

I recommend you to read the document first while NOT trying it actually, THEN you actually try it while using the document as a base. This is because this document is somewhat complicated, and there are many useful notes spread across the document, so at least you know what you're doing. Keep in mind that this tutorial is going to be somewhat lengthy, so you must know what you're doing. Excuse me for my english, it isn't my first language.

Basically, it is the process of savestating the game, getting the pointer to the rom, drawing the flag over the original one and replacing the hex codes of the original game with those of the savestate.

Before we begin, we must understand how flags are formed. Basically, there are two kinds of flags: three-coloured and four-coloured. Open ISSD in your emulator. Go to the team selection menu, and look at the flags. See the flag of France? It has three colours: Blue, White and Red. Almost all flags have three, but some, like Portugal's, have four. Look closely at the portuguese flag, it has actually four colors: Red, Green, Yellow, and Brown (used in the details of the crest).

I haven't figured out *exactly* how to change four-coloured flags, but at least you'll know how to modify three-coloured flags.

2. Explanation

Flags are composed by 6 8x8 pixels, kinda like cutting a rectangle vertically in three and then cutting it again, but horizontally. That way, you'll get 6 divisions. That's how it's formed in the CHR. Programming-wise, each flag has a set of hexes, for the top and bottom division. The calculation of the pointers is made according to the addresses where the hexes are in the ROM.

Three-coloured flags have eight hexes for the top and bottom part, they will need to be replaced by the eight from the save state. Four-coloured flags, however, have ten for each.

Tools you'll need:

International Superstar Soccer Deluxe SNES Rom

zSNES, or any other SNES emulator that doesn't compress it's own savestates

YY-CHR, or some other graphic editor

WindHex32, or any Hex editor

3. Drawing the graphics


Open zSNES, load ISSD. Begin a match playing AGAINST the team whose flag you want to edit. For your player choose someone with equal number of colors, e.g. France (3-color) vs Germany (3-color). Make sure they're distinguishable, like France's and Germany's, and not very similar, like France and Italy's flags. We'll begin first with three-colored, then with four-colored. Start the match. Now, savestate. Close zSNES, now you should have in the same folder as your ISSD rom a file ending with .zst extension, that is the savestate. Now, open your ROM in YY-CHR, on the bottom left, you should see something that says "1bpp", click on it and select 4BPP Snes mode. Press F12 to load .zst in YY-CHR, to get the palettes from it. Press CTRL+M to make a window appear, use backspace to erase the zeroes, and type in manually 02fd43. You'll se graphics appear. You might notice the left part of the player's flag is cut, ignore it. You'll erase the player's flag and begin redrawing it from scratch, while not mattering about the cut part. You must follow the palette exactly like it is in the original one, so don't use extra colors. Don't mind about palettes, we'll change the colors in a next step. That way the enemy's flag remains unedited while the player one is changed. Press Ctrl+O to save. Close the window.

4. In the hex editor

Open the .zst in your hex editor as well as ISSD rom, in separate windows. In the .zst, go to address 02fda3. You'll ignore the FF hexes. Search for the four first hexes in the ISSD rom between FFs, like " 00 03 04 09". You'll find some results pop up in the hex editor. To find out which one is right, you need to see the values around it. Usually, after these three bytes you must find more 4 hexes that match those of the save state, then one that doesn't match the save state, another one that matches the state then a FF hex. I recommend you to check "three-color.png", it is a diagram explaining the order of which hexes are editable and which one isn't. The "pointers" here seem to be setter hexes that do something I haven't figured out yet...

Let's begin editing. In the save state, go to address 02fd43. That's the hexes you must put in the rom, because they're the ones you edited. I recommend you to edit one division at a time, to avoid bugs. I also recommend you to have some shortcut to the emulator, as to playtest faster.

Four-color flags haven't been fully decoded, but they follow a similar format. Use the three-color method for the most part. Four-color flags' hexes in the save-state don't use FF for padding, try to include all hexes. Check "four-color.png" to check the ranges. Yellow ones seem to be pointers, but I don't know for what so ignore them. Green ones are control codes, change them and it'll glitch itself. Black ones are division separators. Blue and reds are editables. Make sure to include all odd-numbered hexes from the savestate (coloured yellow in the diagram), while avoiding "dangerous" hexas!

5.Palettes

Alright, now, assuming your flag/shield has been succesfully modified but the palettes are all wrong, the next step is to change the palettes of it.

Tools you'll need:

SNES Palette Editor
Bsnes debugger

Open your ISSD rom in bsnes debugger. Begin a match between the team whose flag you'd like to edit and some other team with colors that are very different compared to the ones you'd edit, like France vs Germany. You must be playing AS the team which you want to edit the colors. In the match, press start to freeze the game in a Resume/Replay menu. Now, in the emulator's window, go on Tools>Debugger. A new window will appear. In that window, go to S-PPU>Palette Viewer. You'll now be able to view graphically the palettes currently loaded into memory. Click on the 14th color from top to bottom, 15th from left to right. If you did everything right, the description menu to the right of the palette viewer should say it's index is 222.

Below that index is the Red, Green and Blue values. Write'em down, but keep the emulator window open. Open SnesPal. Load your ISSD rom in SnesPal.

See the "<< Search" button on the right? Right BELOW it should be three boxes asking for the Red, Green and Blue values. Put them there and click the Search button. Boom, you should see a bunch of search results pop up. Check them one by one, you'll see the values appear on the top. Check the colors that come immediately before and after that color you searched to see if they match those from the SNES Palette Viewer window. If they do, you can edit them by using the up and down arrows to the right of Address to change the specific color, and drag the RGB bars to change them.

Once you're done, go on File>Save to change your progress. In the bSNES window, go on System>Reload. It'll reset not only the emulator, as well as the rom image. See if it changed. If not, try again.


6. Conclusion

Everything else is normal hexes. Sometimes you'll find regular hexes disguised as control codes, so maybe you can figure out which one is and which isn't a control code in the old-fashioned way: by trial and error. I'm also putting in this document "three-color.png" and "four-color.png", they're primitive diagrams teaching you to edit the flags, so at least you can have a north on figuring out what is and what isn't control codes. And mainly, BACKUP YOUR ROM OFTEN, it is recommended you have a backup before and after the flag hacking.

This method is not only compatible with the original roms, as well as it is with the hacks, such as Futebol Brasileiro 96 and Ronaldinho Soccer.

7. Credits

I didn't write this guide originally, I actually adapted it from a guide I found on PO.B.R.E., a neighbouring romhacking community. It was originally written by Marcos Allan, but I rewrote it to make it more obvious. In general, romhackers like it when someone reuploades their work, mainly when the original author has forgotten about it. While download links still exist, it is very hard to find it, even on PO.B.R.E.'s listing. If Marcos Allan or anyone from PO.B.R.E. wants me to remove this guide, I will remove it.